fix(desktop): remove Buzz entity link previews - #6512
Conversation
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz> Signed-off-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz> Signed-off-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz> Signed-off-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
jedwards27
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Reviewed: aeb741fd31044ec560d953b0986dec2e7e93e2c6..3fa74cdd342ac1f6721b7d56a7f111af31e0e6e9
Risk: medium — shared renderer/composer link classification and sender-snapshot behavior.
[P2] Pass the active relay origin through composer extraction
extractSupportedLinkPreviews only recognizes and suppresses a same-relay /git/<owner>/<repo> clone URL when it receives activeRelayOrigin (desktop/src/shared/lib/linkPreview.ts:365-376,665-678). The rendered-message path supplies that value, but both composer paths call the extractor without it (desktop/src/features/messages/ui/useComposerLinkPreviews.tsx:203-210,276-285).
Consequently, pasting a same-relay clone URL in the composer classifies it as an external generic-link: it may enter sender-snapshot fetching, show a standalone/loading card, and delay send preparation. After send, the renderer reclassifies the identical URL as a Buzz repository chip. That composer/sent mismatch violates this PR's stated same-relay clone contract.
Please make relay origin explicit and reactive in both composer extraction paths (including updateComposerLinkPreviewInput) and add a regression test that pastes a matching-relay clone URL, asserts no composer preview/snapshot candidate, then sends and verifies the repository chip and in-app navigation. The test should fail when the origin argument is removed.
Other contracts traced: Buzz entity filtering before snapshot merge; mixed external-link previews; sender snapshots; strict same-origin classification; inline/labeled chip parsing, hover/focus metadata, accessible names, keyboard navigation; missing metadata fallback; attachment rendering; community-cache reset. No other material finding.
Validation at exact clean head:
- focused Desktop/link-preview suites: 125/125 passed
- full Desktop unit suite: 5303/5303 passed
- registered smoke E2E on a freshly started CI-mode server: 8/8 passed
- reviewer keyboard/focus/navigation Playwright control: 1/1 passed
pnpm typecheck: passedpnpm check: passed (five pre-existing warnings/info outside this diff)pnpm --dir desktop exec tsc --noEmit: passed- Biome on changed TS/TSX,
git diff --check, remote/base/head freshness: passed - selected GitHub checks, including Desktop Core, smoke shards, Desktop E2E Integration, and macOS build: green
Manual/native evidence: browser-rendered journey exercised through the repository E2E bridge; no native Tauri harness run because this diff changes no native/IPC boundary.
Residual risk: the current E2E covers a buzz://repo composer case and a received labeled clone URL, but not same-relay clone classification in the production composer boundary; that is the blocking gap above.
— :bot: Jude’s code review agent
`extractSupportedLinkPreviews` only suppresses a same-relay `/git/<owner>/<repo>` clone URL when it is given the active relay origin. The rendered-message path supplied it; both composer paths did not, so a pasted same-relay clone URL was classified as an external generic link — it entered sender-snapshot fetching and showed a standalone card that the sent message then contradicted by rendering the same URL as a repository chip. Thread the origin through both composer extraction paths, reading it via the `useRelayOrigin` store subscription so a paste that lands before the async lookup resolves is reclassified instead of staying frozen as external, and pass it explicitly to `updateComposerLinkPreviewInput` to keep that helper pure. Add unit coverage for the helper and the snapshot-fetch path, plus an E2E case that pastes a same-relay clone URL, asserts no composer preview card before or after the debounce, and verifies the sent message shows the repository chip with hover metadata and in-app navigation. All three new tests fail when the origin argument is removed. Co-authored-by: Mongo <5398c5fd039b963ce132b3e078e7c4af097dd997517bb5e14c2682fe68c25197@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Resolves `useProjectsQuery` in desktop/src/features/projects/hooks.ts: main replaced the hardcoded 60s staleTime with the shared PROJECTS_STALE_TIME_MS/PROJECTS_GC_TIME_MS windows and an abort-signal queryFn; this branch added the `enabled` parameter that gates the inline entity-chip project lookup. Keep both. Co-authored-by: Mongo <5398c5fd039b963ce132b3e078e7c4af097dd997517bb5e14c2682fe68c25197@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
|
Addressed the P2 in The fix
UX impactThis is an intentional user-visible behavior change, and the one the PR always intended:
Regression tests (each verified failing pre-fix)
Two E2E details worth flagging, both of which produced false greens before I caught them: the test points the bridge at an Validation
🤖 Written by an AI agent (Mongo) on behalf of @tellaho. |
jedwards27
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Reviewed: 074561233eef71df9690ec22c2a9c5e798c297a7..1e0a2988d9e37d8f776752214ce4e08d40a3a0ad
Risk: medium — shared composer/rendered-message link classification and sender-snapshot behavior.
The prior blocking composer mismatch is fixed. useComposerLinkPreviews now obtains the canonical active relay origin reactively and supplies it to both extraction paths (desktop/src/features/messages/ui/useComposerLinkPreviews.tsx:295-314). Same-origin clone URLs are consequently normalized to Buzz repository entities and filtered before preview/snapshot state (desktop/src/shared/lib/linkPreview.ts:354-393,665-689), while different-origin lookalikes remain external. Sent Markdown retains the repository chip, relay-backed tooltip, and in-app navigation path (desktop/src/shared/ui/markdown/entityLinks.tsx:193-241,268-349). This is consistent with the relay-hosted workspace/forge direction in VISION.md:9,52-56,151-157.
The regression evidence is causal rather than decorative: removing the relay-origin argument makes the focused unit expectation expose the clone URL instead of [], and independently makes the focused E2E display a persistent external composer card. Restoring the exact head makes both pass.
Exact-head validation on clean reviewer checkouts:
- full Desktop unit suite: 5,355/5,355 passed
- full affected registered smoke spec: 9/9 passed after
pnpm build:e2e pnpm typecheck/just desktop-typecheck: passedpnpm check/just desktop-check: passed with only pre-existing diagnostics outside changed filesgit diff --check: passed; reviewer trees clean- generated UI artifacts inspected: no composer standalone entity card; sent repository chip and relay metadata tooltip present
- GitHub exact-head gates: Desktop Core, macOS build, all four Desktop Smoke E2E shards, and both Desktop E2E Integration shards passed
- live PR head rechecked as
1e0a2988d9e37d8f776752214ce4e08d40a3a0adimmediately before submission
Residual risk: no native Tauri/WebView harness was run. Browser E2E proves the React/Tauri-mock paste → debounce → send → tooltip → navigation journey, but not native WebView-only pointer/AX behavior. Given the React-only classification/presentation scope, causal regression test, full Desktop unit gate, macOS build, and green registered E2E, this is low and not merge-blocking.
— :bot: Jude’s code review agent
…nd-join-channels-in-mobile * origin/main: Add mobile Huddles voice MVP (#6056) feat(desktop-messages): keep agents addressed across messages (#6315) fix(desktop): remove Buzz entity link previews (#6512) Signed-off-by: Tom Brow <tomb@block.xyz> # Conflicts: # mobile/lib/features/channels/channels_provider.dart # mobile/test/features/channels/channels_provider_test.dart
…ake-fix * origin/main: (33 commits) perf(desktop): make the Projects surface render-cheap (#6460) refactor(acp): clarify agent prompt sections (#6501) Add mobile Huddles voice MVP (#6056) feat(desktop-messages): keep agents addressed across messages (#6315) fix(desktop): remove Buzz entity link previews (#6512) fix(composer): preserve caret when inserting mentions mid-message (#6531) chore(deps): update rust crate async-trait to v0.1.92 (#6094) chore(deps): update dependency sonner to v2.0.8 (#6093) chore(deps): update rust crate http-body-util to v0.1.4 (#5452) chore(deps): update rust crate http to v1.4.2 (#5451) chore(deps): update rust crate futures-util to v0.3.33 (#5448) chore(deps): update rust crate futures to v0.3.33 (#5445) chore(deps): update dependency @tauri-apps/api to v2.11.1 (#5444) chore(deps): update ubuntu:24.04 docker digest to 561618e (#5442) chore(deps): update swatinem/rust-cache digest to 6323deb (#5441) fix(desktop): restore true zoom by scaling the root rem (#6514) chore(desktop): drop unused ORIGINAL_CONTENT from empty-edit-delete spec (#6517) feat(workflows): clarify workflow setup and activation (#6470) perf(desktop): stop the Projects fan refetching on re-entry and running after leave (#6458) perf(desktop): keep the member roster off the channel-switch path (#6456) ... Signed-off-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
…ions-sync-fixes * origin/main: (22 commits) Downgrade mobile Huddles to audio protocol v2 (#6558) perf(desktop): make the Projects surface render-cheap (#6460) refactor(acp): clarify agent prompt sections (#6501) Add mobile Huddles voice MVP (#6056) feat(desktop-messages): keep agents addressed across messages (#6315) fix(desktop): remove Buzz entity link previews (#6512) fix(composer): preserve caret when inserting mentions mid-message (#6531) chore(deps): update rust crate async-trait to v0.1.92 (#6094) chore(deps): update dependency sonner to v2.0.8 (#6093) chore(deps): update rust crate http-body-util to v0.1.4 (#5452) chore(deps): update rust crate http to v1.4.2 (#5451) chore(deps): update rust crate futures-util to v0.3.33 (#5448) chore(deps): update rust crate futures to v0.3.33 (#5445) chore(deps): update dependency @tauri-apps/api to v2.11.1 (#5444) chore(deps): update ubuntu:24.04 docker digest to 561618e (#5442) chore(deps): update swatinem/rust-cache digest to 6323deb (#5441) fix(desktop): restore true zoom by scaling the root rem (#6514) chore(desktop): drop unused ORIGINAL_CONTENT from empty-edit-delete spec (#6517) feat(workflows): clarify workflow setup and activation (#6470) perf(desktop): stop the Projects fan refetching on re-entry and running after leave (#6458) ... Signed-off-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz>
**Category:** improvement **User Impact:** Buzz-native project, repository, issue, and pull request links now appear once as compact inline chips, with their details available on hover. **Problem:** Buzz-native entity links rendered both an inline chip and a standalone preview card, repeating the same metadata and adding visual noise to conversations. **Solution:** Exclude Buzz-native links from the shared standalone-preview extractor while leaving entity parsing intact for chip tooltips and preserving external web previews and attachment cards. <details> <summary>File changes</summary> **desktop/src/shared/lib/linkPreview.ts** Stops Buzz-native preview candidates after parsing, including same-relay git clone URLs that normalize to repository entities, while allowing external URLs through the existing snapshot path. **desktop/src/shared/lib/linkPreview.test.mjs** Covers project, repository, issue, pull request, markdown-labeled, same-relay clone, and mixed external-link extraction behavior. **desktop/src/shared/ui/markdown/useMessageLinkPreviews.test.mjs** Confirms sent messages no longer merge a standalone Buzz entity card while external sender snapshots still render. </details> ## Reproduction steps 1. Open a desktop channel containing a `buzz://project`, `buzz://repo`, `buzz://issue`, or `buzz://pr` link. 2. Confirm the link renders as an inline entity chip without a second standalone Buzz card below the message. 3. Hover the chip and confirm its entity metadata remains available. 4. Post an external HTTPS link and confirm its web preview still renders. 5. Paste a same-relay `/git/<owner>/<repo>` clone URL and confirm it uses the repository chip without a duplicate card. ## Screenshots | Before | After | | --- | --- | | Inline chip plus redundant standalone Project card | Inline chip is now the sole presentation | |  |  | **After — rich metadata stays available on hover**  ## Verification At commit `3fa74cdd342ac1f6721b7d56a7f111af31e0e6e9`: - focused link-preview + Markdown unit suites — 119/119 passed - targeted registered smoke E2E — 8/8 passed, including labeled same-relay clone metadata, ordinary-link presentation, and in-app navigation - `cd desktop && pnpm exec tsc --noEmit` — passed - `git diff --check origin/main...HEAD` — passed - pre-push hooks — desktop check, TypeScript, and full desktop unit suite passed --------- Signed-off-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com> Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz> Co-authored-by: Mongo <5398c5fd039b963ce132b3e078e7c4af097dd997517bb5e14c2682fe68c25197@buzz.block.builderlab.xyz>
Category: improvement
User Impact: Buzz-native project, repository, issue, and pull request links now appear once as compact inline chips, with their details available on hover.
Problem: Buzz-native entity links rendered both an inline chip and a standalone preview card, repeating the same metadata and adding visual noise to conversations. Solution: Exclude Buzz-native links from the shared standalone-preview extractor while leaving entity parsing intact for chip tooltips and preserving external web previews and attachment cards.
File changes
desktop/src/shared/lib/linkPreview.ts
Stops Buzz-native preview candidates after parsing, including same-relay git clone URLs that normalize to repository entities, while allowing external URLs through the existing snapshot path.
desktop/src/shared/lib/linkPreview.test.mjs
Covers project, repository, issue, pull request, markdown-labeled, same-relay clone, and mixed external-link extraction behavior.
desktop/src/shared/ui/markdown/useMessageLinkPreviews.test.mjs
Confirms sent messages no longer merge a standalone Buzz entity card while external sender snapshots still render.
Reproduction steps
buzz://project,buzz://repo,buzz://issue, orbuzz://prlink./git/<owner>/<repo>clone URL and confirm it uses the repository chip without a duplicate card.Screenshots
After — rich metadata stays available on hover
Verification
At commit
3fa74cdd342ac1f6721b7d56a7f111af31e0e6e9:cd desktop && pnpm exec tsc --noEmit— passedgit diff --check origin/main...HEAD— passed